package net.onecloud.onecloud.model;

import android.os.Parcel;
import android.os.Parcelable;

import java.util.List;

/**
 * Created by zaizai on 16/7/31.
 */
public class ResultRecord implements Parcelable {


    private int code;
    private int success;
    private int more;
    private String message;


    private List<DataEntity> data;

    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public int getSuccess() {
        return success;
    }

    public void setSuccess(int success) {
        this.success = success;
    }

    public int getMore() {
        return more;
    }

    public void setMore(int more) {
        this.more = more;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    public List<DataEntity> getData() {
        return data;
    }

    public void setData(List<DataEntity> data) {
        this.data = data;
    }

    public static Creator<ResultRecord> getCREATOR() {
        return CREATOR;
    }

    public static class DataEntity implements Parcelable {

        private String id;
        private String rdate;
        private String rcampany;
        private String rpost;
        private String user_id;
        private String post_id;

        public String getId() {
            return id;
        }

        public void setId(String id) {
            this.id = id;
        }

        public String getRdate() {
            return rdate;
        }

        public void setRdate(String rdate) {
            this.rdate = rdate;
        }

        public String getRcampany() {
            return rcampany;
        }

        public void setRcampany(String rcampany) {
            this.rcampany = rcampany;
        }

        public String getRpost() {
            return rpost;
        }

        public void setRpost(String rpost) {
            this.rpost = rpost;
        }

        public String getUser_id() {
            return user_id;
        }

        public void setUser_id(String user_id) {
            this.user_id = user_id;
        }

        public String getPost_id() {
            return post_id;
        }

        public void setPost_id(String post_id) {
            this.post_id = post_id;
        }

        @Override
        public int describeContents() {
            return 0;
        }

        @Override
        public void writeToParcel(Parcel dest, int flags) {
            dest.writeString(this.id);
            dest.writeString(this.rdate);
            dest.writeString(this.rcampany);
            dest.writeString(this.rpost);
            dest.writeString(this.user_id);
            dest.writeString(this.post_id);
        }

        public DataEntity() {
        }

        protected DataEntity(Parcel in) {
            this.id = in.readString();
            this.rdate = in.readString();
            this.rcampany = in.readString();
            this.rpost = in.readString();
            this.user_id = in.readString();
            this.post_id = in.readString();
        }

        public static final Creator<DataEntity> CREATOR = new Creator<DataEntity>() {
            @Override
            public DataEntity createFromParcel(Parcel source) {
                return new DataEntity(source);
            }

            @Override
            public DataEntity[] newArray(int size) {
                return new DataEntity[size];
            }
        };
    }


    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeInt(this.code);
        dest.writeInt(this.success);
        dest.writeInt(this.more);
        dest.writeString(this.message);
        dest.writeTypedList(this.data);
    }

    public ResultRecord() {
    }

    protected ResultRecord(Parcel in) {
        this.code = in.readInt();
        this.success = in.readInt();
        this.more = in.readInt();
        this.message = in.readString();
        this.data = in.createTypedArrayList(DataEntity.CREATOR);
    }

    public static final Parcelable.Creator<ResultRecord> CREATOR = new Parcelable.Creator<ResultRecord>() {
        @Override
        public ResultRecord createFromParcel(Parcel source) {
            return new ResultRecord(source);
        }

        @Override
        public ResultRecord[] newArray(int size) {
            return new ResultRecord[size];
        }
    };
}
